package mianxiangduixiang.Test4.Exam2;

public class Square implements Shape {
    private double length;
    private double width;

    public double getLength() {
        return length;
    }

    public void setLength(double length) {
        this.length = length;
    }

    public double getWidth() {
        return width;
    }

    public void setWidth(double width) {
        this.width = width;
    }

    public Square(double length, double width) {
        this.length = length;
        this.width = width;
    }

    @Override
    public String toString() {
        return "长方形的长为" + length + " 长方形的宽为" + width;
    }

    @Override
    public double getArea() {
        return width * length * 1.00;
    }

    @Override
    public double getPerimeter() {
        return (width + length) * 2.00;
    }
}
